Skip to content

Improve processing of truncated GIFs#234

Merged
kornelski merged 3 commits into
image-rs:masterfrom
mhils:truncated
Apr 29, 2026
Merged

Improve processing of truncated GIFs#234
kornelski merged 3 commits into
image-rs:masterfrom
mhils:truncated

Conversation

@mhils
Copy link
Copy Markdown
Contributor

@mhils mhils commented Apr 14, 2026

This commit adds a dedicated error variant for truncation and ensures that the
unused part of the output buffer is zeroed. This allows users to explicitly handle
truncation and still display the image if desired.

Thank you for your fantastic work on image-gif! 😃

mhils added 2 commits April 23, 2026 09:45
This commit adds a dedicated error variant for truncation and ensures that the
unused part of the output buffer is zeroed. This allows users to display incomplete
images, matching the functionality of giflib.
Copy link
Copy Markdown
Member

@197g 197g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do like the approach, zeroing explicitly is easiest to adjust later if we'd want to offer other fill (opaque black) or even just record the ranges that were affect. LGTM except the internal API nit.

Comment thread src/reader/converter.rs Outdated
@kornelski kornelski merged commit ccf4ade into image-rs:master Apr 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants